function foo(num){
    var foo // undefind
    console.log(foo)// undefind
    foo = num
    // 10
    console.log(foo)
}
foo(10)
console.log(foo)
foo = 1;
console.log(foo)

// undefind   10  [Function: foo]  1